/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package colloque.forms;

import colloque.Colloque;
import colloque.helpers.ColloqueHelper;
import colloque.helpers.UtilisateurHelper;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author Thomas
 */
public class EnrgResume extends HttpServlet {

    
    /**
     *
     * @param request
     * @param response
     * @throws ServletException
     * @throws IOException
     */
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
        
        /*----- Vérification des paramètres saisis par l'utilisateur -----*/
		String nom = request.getParameter("nom");
		String prenom = request.getParameter("prenom");
                String mail = request.getParameter("mail");
		String institution = request.getParameter("institution");
                String mc1 = request.getParameter("mc1");
		String mc2 = request.getParameter("mc2");
                String mc3 = request.getParameter("mc3");
		//String id = request.getParameter("identifiant");
                String password = request.getParameter("motpasse");
		
		
        // insert into UTILISATEUR (
        // insert into expose 
                
         //on connait id de linstitution
                
                ColloqueHelper colH=new ColloqueHelper();
            //    colH.creer(nom);
       /* Colloque col;
        ColloqueHelper colH=new ColloqueHelper();
        col=colH.getColloqueByNom("Oracle");
          System.out.println("coucou");
        System.out.println(col.getColloqueid());
        UtilisateurHelper user = new UtilisateurHelper();
        user.addnewuser(nom, prenom, mail, null,col);
        */
        
        try {
            /* TODO output your page here. You may use following sample code. */
            out.println("<html>");
            out.println("<head>");
            out.println("<title>Servlet EnrgResume</title>");            
            out.println("</head>");
            out.println("<body>");
           out.println("Nom ="+nom);
            out.println("</body>");
            out.println("</html>");
        } finally {            
            out.close();
        }
    }

    // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
    /**
     * Handles the HTTP
     * <code>GET</code> method.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        processRequest(request, response);
    }

    /**
     * Handles the HTTP
     * <code>POST</code> method.
     *
     * @param request servlet request
     * @param response servlet response
     * @throws ServletException if a servlet-specific error occurs
     * @throws IOException if an I/O error occurs
     */
    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        processRequest(request, response);
    }

    /**
     * Returns a short description of the servlet.
     *
     * @return a String containing servlet description
     */
    @Override
    public String getServletInfo() {
        return "Short description";
    }// </editor-fold>
}
